/**
 *******************************************************************************
 * @FileName  : iic.c
 * @Author    : GaoQiu
 * @CreateDate: 2020-05-18
 * @Copyright : Copyright(C) GaoQiu
 *              All Rights Reserved.
 *******************************************************************************
 */
#include "iic.h"
#include "platform/platform.h"

#define SCL_PIN   GPIO_PC2
#define SDA_PIN   GPIO_PC3

void IIC_SetUp(void)
{
	RCC_EnablePeriphClk(RCC_IIC);

	GPIO_SetPullModeEx(SCL_PIN, GPIO_PullUp_Weak);
	GPIO_SetPullModeEx(SDA_PIN, GPIO_PullUp_Weak);

	GPIO_InitEx(SCL_PIN, GPIO_Mode_AF_In);
	GPIO_InitEx(SDA_PIN, GPIO_Mode_AF_In);

	GPIO_SetAlternFuncEx(SCL_PIN, GPIO_AF_IIC);
	GPIO_SetAlternFuncEx(SDA_PIN, GPIO_AF_IIC);

	I2C_MstInit(400000, 0x78, 48000000);
}

void IIC_Loop(void)
{

}
